package us.kg.kotoriforest.springmvc.restful.exception;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

/**
 * 业务异常
 *
 * @author Kotori rotroutine@163.com
 * @since 2025/2/8
 */

@NoArgsConstructor
@AllArgsConstructor
@Getter
@Setter
public class BizException extends RuntimeException {
    private int code;
    private String message;

    public BizException(BizExceptionEnum bizExceptionEnum) {
        this.code = bizExceptionEnum.getCode();
        this.message = bizExceptionEnum.getMessage();
    }
}
